cmake_minimum_required(VERSION 3.4.1)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -UNDEBUG -march=armv8.2-a+fp16")
set(CMAKE_CXX_STANDARD  17)

include_directories(${CMAKE_SOURCE_DIR}/include)
include_directories(${CMAKE_SOURCE_DIR}/HIAI_DEMO)

add_library(hiai SHARED IMPORTED)
set_target_properties(hiai PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/${ANDROID_ABI}/libhiai.so)

add_library(hiai_ir SHARED IMPORTED)
set_target_properties(hiai_ir PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/${ANDROID_ABI}/libhiai_ir.so)

add_library(hiai_ir_build SHARED IMPORTED)
set_target_properties(hiai_ir_build PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/${ANDROID_ABI}/libhiai_ir_build.so)

add_library(native-codec-jni SHARED
            looper.cpp
            native-codec-jni.cpp
            HIAI_DEMO/ir_build.cpp
        )

# Include libraries needed for native-codec-jni lib
target_link_libraries(native-codec-jni
                      android
                      hiai
                      hiai_ir
                      hiai_ir_build
                      log
                      mediandk
                      OpenMAXAL)

